package com.party.core.service.member.impl;

import com.party.common.paging.Page;
import com.party.core.dao.read.member.MemberAdministratorReadDao;
import com.party.core.dao.read.partner.MemberPartnerPrivilegeReadDao;
import com.party.core.dao.write.member.MemberAdministratorWriteDao;
import com.party.core.dao.write.partner.MemberPartnerPrivilegeWriteDao;
import com.party.core.model.BaseModel;
import com.party.core.model.member.MemberAdministrator;
import com.party.core.service.member.IMemberAdministratorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @Author: huangzequn
 * @Date: 2019/3/6 10:38
 * 用户是否对应所有的机构（数据权限查看）
 */
@Service
public class MemberAdministratorService implements IMemberAdministratorService {

    @Autowired
    private MemberAdministratorWriteDao memberAdministratorWriteDao;
    @Autowired
    private MemberAdministratorReadDao memberAdministratorReadDao;

    @Override
    public String insert(MemberAdministrator memberAdministrator) {
        BaseModel.preInsert(memberAdministrator);
        boolean result = memberAdministratorWriteDao.insert(memberAdministrator);
        if (result) {
            return memberAdministrator.getId();
        }
        return null;
    }

    @Override
    public boolean update(MemberAdministrator memberAdministrator) {
        return false;
    }

    @Override
    public boolean deleteLogic(String id) {
        return false;
    }

    @Override
    public boolean delete(String id) {
        return false;
    }

    @Override
    public boolean batchDeleteLogic(Set<String> ids) {
        return false;
    }

    @Override
    public boolean batchDelete(Set<String> ids) {
        return false;
    }

    @Override
    public MemberAdministrator get(String id) {
        return null;
    }

    @Override
    public List<MemberAdministrator> listPage(MemberAdministrator memberAdministrator, Page page) {
        return null;
    }

    @Override
    public List<MemberAdministrator> list(MemberAdministrator memberAdministrator) {
        return null;
    }

    @Override
    public List<MemberAdministrator> batchList(Set<String> ids, MemberAdministrator memberAdministrator, Page page) {
        return null;
    }

    @Override
    public int deleteByMemberId(String initiatorId) {
        return memberAdministratorWriteDao.deleteByMemberId(initiatorId);
    }

    @Override
    public MemberAdministrator getByMemberId(String initiatorId) {
        return memberAdministratorReadDao.getByMemberId(initiatorId);
    }

    @Override
    public List<Map<String, String>> findByPartnerId() {
        return memberAdministratorReadDao.findByPartnerId();
    }
}
